package com.luoxiang.socialandroid.utils

import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.lifecycleScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

class DelayUtil(private var lifecycleOwner: LifecycleOwner) {

    fun delayJob(delayTime: Long,block: () -> Unit){
        lifecycleOwner.lifecycleScope.launch {
            delay(delayTime)
            block.invoke()
        }
    }
}